import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import router from './router'
import './style.css'
import App from './App.vue'
import { useUserStore } from './stores/user'
import { useThemeStore } from './stores/theme'

const app = createApp(App)
app.use(createPinia())
// 提前加载本地用户与会话，避免登录页找不到内置账号
useUserStore().hydrate()
useThemeStore().hydrate()
app.use(router)
app.use(ElementPlus)
app.mount('#app')
